//
// Created by sai on 2019/2/27.
//

#ifndef DOUBLELINKED_LIST_DOUBLYLINKEDLIST_H
#define DOUBLELINKED_LIST_DOUBLYLINKEDLIST_H

#include <stdbool.h>
#include <stdlib.h>
#include <assert.h>
#include <stdio.h>
typedef int ElementType;
struct Node;
struct List;
typedef struct List *DoublyList;
typedef struct Node *Position;

bool IsLast(Position pos, DoublyList list);

bool IsFirst(Position pos, DoublyList list);

bool IsEmpty(DoublyList list);

DoublyList MakeEmpty(DoublyList list);

Position Find(ElementType elem, DoublyList list);

Position FindPrevious(ElementType elem, DoublyList list);

void DeletePosition(ElementType elem, DoublyList list);

void DeleteNode(ElementType elem, DoublyList list);

void InsertPosition(ElementType elem, DoublyList list, Position pos);

void InsertNode(ElementType elem, DoublyList list, Position pos);

void DeleteDoublyList(DoublyList list);


void Append(DoublyList list, ElementType elem);

void Adance(DoublyList list, Position pos);

void Retreat(DoublyList list, Position pos);

void Print_DoublyList(DoublyList list);

#endif //DOUBLELINKED_LIST_DOUBLYLINKEDLIST_H
struct Node {
    ElementType date;
    Position prev;
    Position next;
};
struct List {
    Position FirstNode;
    Position LastNode;
    int Len;
};